"use client";
import React from "react";
import {Button} from "@mantine/core";
import {IconFilter, IconFilterFilled} from "@tabler/icons-react";
import {useIpdTableContext} from "./context";

export function ButtonFilter() {
  const {collapse, setCollapse} = useIpdTableContext();
  return (
    <Button
      variant="default"
      size="xs"
      radius="sm"
      onClick={() => setCollapse(!collapse)}
      leftSection={collapse ? <IconFilterFilled size={14} /> : <IconFilter size={14} />}
    >
      {collapse ? "收起筛选" : "展开筛选"}
    </Button>
  );
}
